<!DOCTYPE html>
<html>
<head>
    

    

    



    <meta charset="utf-8">
    
    
    
    <title>MongoDB | 尼古拉斯-鱼丸博客 | 喝酒、吃肉、不赌</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="theme-color" content="#3F51B5">
    
    
    <meta name="keywords" content="SpringBoot,MongoDB">
    <meta name="description" content="SpringBoot整合MongoDB什么是MongoDB?   MongoDB是一个基于分布式文件存储的数据库。由C++语言编写。旨在为WEB应用提供可扩展的高性能数据存储解决方案。MongoDB是一个介于关系数据库和非关系数据库(nosql)之间的产品，是非关系数据库当中功能最丰富，最像关系数据库的。 链接: MongoDB文档 MongoDB使用场景1.数据库需要横向扩展能力的，用来存储数据">
<meta name="keywords" content="SpringBoot,MongoDB">
<meta property="og:type" content="article">
<meta property="og:title" content="MongoDB">
<meta property="og:url" content="http://fish_08.oschina.io/2017/06/28/mongodb/index.html">
<meta property="og:site_name" content="尼古拉斯-鱼丸博客">
<meta property="og:description" content="SpringBoot整合MongoDB什么是MongoDB?   MongoDB是一个基于分布式文件存储的数据库。由C++语言编写。旨在为WEB应用提供可扩展的高性能数据存储解决方案。MongoDB是一个介于关系数据库和非关系数据库(nosql)之间的产品，是非关系数据库当中功能最丰富，最像关系数据库的。 链接: MongoDB文档 MongoDB使用场景1.数据库需要横向扩展能力的，用来存储数据">
<meta property="og:updated_time" content="2017-06-28T08:16:51.556Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="MongoDB">
<meta name="twitter:description" content="SpringBoot整合MongoDB什么是MongoDB?   MongoDB是一个基于分布式文件存储的数据库。由C++语言编写。旨在为WEB应用提供可扩展的高性能数据存储解决方案。MongoDB是一个介于关系数据库和非关系数据库(nosql)之间的产品，是非关系数据库当中功能最丰富，最像关系数据库的。 链接: MongoDB文档 MongoDB使用场景1.数据库需要横向扩展能力的，用来存储数据">
    
        <link rel="alternative" href="/atom.xml" title="尼古拉斯-鱼丸博客" type="application/atom+xml">
    
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="/css/style.css?v=1.6.7">
    <script>window.lazyScripts=[]</script>
</head>

<body>
    <div id="loading" class="active"></div>

    <aside id="menu" class="hide" >
  <div class="inner flex-row-vertical">
    <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menu-off">
        <i class="icon icon-lg icon-close"></i>
    </a>
    <div class="brand-wrap">
      <div class="brand">
        <a href="/" class="avatar waves-effect waves-circle waves-light">
          <img src="/img/avatar.jpg">
        </a>
        <hgroup class="introduce">
          <h5 class="nickname">于亮</h5>
          <a href="mailto:136214289@qq.com" title="136214289@qq.com" class="mail">136214289@qq.com</a>
        </hgroup>
      </div>
    </div>
    <div class="scroll-wrap flex-col">
      <ul class="nav">
        
            <li class="waves-block waves-effect">
              <a href="/"  >
                <i class="icon icon-lg icon-home"></i>
                主页
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/archives"  >
                <i class="icon icon-lg icon-archives"></i>
                文档
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/tags"  >
                <i class="icon icon-lg icon-tags"></i>
                标签
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://git.oschina.net/fish_08" target="_blank" >
                <i class="icon icon-lg icon-github"></i>
                Github
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="http://weibo.com/2837335591/profile?rightmod=1&wvr=6&mod=personinfo" target="_blank" >
                <i class="icon icon-lg icon-weibo"></i>
                Weibo
              </a>
            </li>
        
            <li class="waves-block waves-effect">
              <a href="/custom"  >
                <i class="icon icon-lg icon-link"></i>
                测试
              </a>
            </li>
        
      </ul>
    </div>
  </div>
</aside>

    <main id="main">
        <header class="top-header" id="header">
    <div class="flex-row">
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light on" id="menu-toggle">
          <i class="icon icon-lg icon-navicon"></i>
        </a>
        <div class="flex-col header-title ellipsis">MongoDB</div>
        
        <div class="search-wrap" id="search-wrap">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="back">
                <i class="icon icon-lg icon-chevron-left"></i>
            </a>
            <input type="text" id="key" class="search-input" autocomplete="off" placeholder="输入感兴趣的关键字">
            <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="search">
                <i class="icon icon-lg icon-search"></i>
            </a>
        </div>
        
        
        <a href="javascript:;" class="header-icon waves-effect waves-circle waves-light" id="menuShare">
            <i class="icon icon-lg icon-share-alt"></i>
        </a>
        
    </div>
</header>
<header class="content-header post-header">

    <div class="container fade-scale">
        <h1 class="title">MongoDB</h1>
        <h5 class="subtitle">
            
                <time datetime="2017-06-28T08:16:51.555Z" itemprop="datePublished" class="page-time">
  2017-06-28
</time>


            
        </h5>
    </div>

    

</header>


<div class="container body-wrap">
    
    <aside class="post-widget">
        <nav class="post-toc-wrap" id="post-toc">
            <h4>TOC</h4>
            <ol class="post-toc"><li class="post-toc-item post-toc-level-2"><a class="post-toc-link" href="#SpringBoot整合MongoDB"><span class="post-toc-number">1.</span> <span class="post-toc-text">SpringBoot整合MongoDB</span></a><ol class="post-toc-child"><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#什么是MongoDB"><span class="post-toc-number">1.1.</span> <span class="post-toc-text">什么是MongoDB?</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#MongoDB使用场景"><span class="post-toc-number">1.2.</span> <span class="post-toc-text">MongoDB使用场景</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#MongoDB安装和使用"><span class="post-toc-number">1.3.</span> <span class="post-toc-text">MongoDB安装和使用</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#MongoDB依赖引入"><span class="post-toc-number">1.4.</span> <span class="post-toc-text">MongoDB依赖引入</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#MongoDB参数配置"><span class="post-toc-number">1.5.</span> <span class="post-toc-text">MongoDB参数配置</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#MongoDB存取实体类"><span class="post-toc-number">1.6.</span> <span class="post-toc-text">MongoDB存取实体类</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#定义MongoDB存取接口"><span class="post-toc-number">1.7.</span> <span class="post-toc-text">定义MongoDB存取接口</span></a></li><li class="post-toc-item post-toc-level-3"><a class="post-toc-link" href="#测试存取操作"><span class="post-toc-number">1.8.</span> <span class="post-toc-text">测试存取操作</span></a></li></ol></li></ol>
        </nav>
    </aside>
    
<article id="post-mongodb"
  class="post-article article-type-post fade" itemprop="blogPost">

    <div class="post-card">
        <h1 class="post-card-title">MongoDB</h1>
        <div class="post-meta">
            <time class="post-time" title="2017年06月28日 16:16" datetime="2017-06-28T08:16:51.555Z"  itemprop="datePublished">2017-06-28</time>

            


            
<span id="busuanzi_container_page_pv" title="文章总阅读量" style='display:none'>
    <i class="icon icon-eye icon-pr"></i><span id="busuanzi_value_page_pv"></span>
</span>


            

        </div>
        <div class="post-content" id="post-content" itemprop="postContent">
            <h2 id="SpringBoot整合MongoDB"><a href="#SpringBoot整合MongoDB" class="headerlink" title="SpringBoot整合MongoDB"></a>SpringBoot整合MongoDB</h2><h3 id="什么是MongoDB"><a href="#什么是MongoDB" class="headerlink" title="什么是MongoDB?"></a>什么是MongoDB?</h3><p>   MongoDB是一个基于分布式文件存储的数据库。由C++语言编写。旨在为WEB应用提供可扩展的高性能数据存储解决方案。MongoDB是一个介于关系数据库和非关系数据库(nosql)之间的产品，是非关系数据库当中功能最丰富，最像关系数据库的。</p>
<p>链接: <a href="http://www.mongodb.org.cn/tutorial/" target="_blank" rel="external">MongoDB文档</a></p>
<h3 id="MongoDB使用场景"><a href="#MongoDB使用场景" class="headerlink" title="MongoDB使用场景"></a>MongoDB使用场景</h3><p>1.数据库需要横向扩展能力的，用来存储数据规模会在未来非常巨大的数据，如日志、评论等等。</p>
<p>2.对于数据事务性要求不高的操作，MongoDB 目前只支持单文档事务，需要复杂事务支持的场景暂时不适合。</p>
<p>从目前阿里云 MongoDB 云数据库上的用户看，MongoDB 的应用已经渗透到各个领域，比如游戏、物流、电商、内容管理、社交、物联网、视频直播等，以下是几个实际的应用案例。       </p>
<table>
<thead>
<tr>
<th style="text-align:left">应用场景</th>
<th style="text-align:left">应用案例</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">游戏场景</td>
<td style="text-align:left">使用 MongoDB 存储游戏用户信息，用户的装备、积分等直接以内嵌文档的形式存储，方便查询、更新</td>
</tr>
<tr>
<td style="text-align:left">物流场景</td>
<td style="text-align:left">使用 MongoDB 存储订单信息，订单状态在运送过程中会不断更新，以 MongoDB 内嵌数组的形式来存储，一次查询就能将订单所有的变更读取出来。</td>
</tr>
<tr>
<td style="text-align:left">社交场景</td>
<td style="text-align:left">使用 MongoDB 存储存储用户信息，以及用户发表的朋友圈信息，通过地理位置索引实现附近的人、地点等功能</td>
</tr>
<tr>
<td style="text-align:left">物联网场景</td>
<td style="text-align:left">使用 MongoDB 存储所有接入的智能设备信息，以及设备汇报的日志信息，并对这些信息进行多维度的分析</td>
</tr>
<tr>
<td style="text-align:left">视频直播</td>
<td style="text-align:left">使用 MongoDB 存储用户信息、礼物信息等……</td>
</tr>
<tr>
<td style="text-align:left">…..</td>
<td style="text-align:left">?</td>
</tr>
</tbody>
</table>
<p>如果你还在为是否应该使用 MongoDB，不如来做几个选择题来辅助决策（注：以下内容改编自 MongoDB 公司 TJ 同学的某次公开技术分享）。                                                </p>
<table>
<thead>
<tr>
<th style="text-align:left">应用特征</th>
<th style="text-align:left">Yes / No</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">应用不需要事务及复杂 join 支持</td>
<td style="text-align:left">必须 Yes</td>
</tr>
<tr>
<td style="text-align:left">新应用，需求会变，数据模型无法确定，想快速迭代开发</td>
<td style="text-align:left">？</td>
</tr>
<tr>
<td style="text-align:left">应用需要2000-3000以上的读写QPS（更高也可以）</td>
<td style="text-align:left">？</td>
</tr>
<tr>
<td style="text-align:left">应用需要TB甚至 PB 级别数据存储</td>
<td style="text-align:left">?</td>
</tr>
<tr>
<td style="text-align:left">应用发展迅速，需要能快速水平扩展</td>
<td style="text-align:left">?</td>
</tr>
<tr>
<td style="text-align:left">应用要求存储的数据不丢失</td>
<td style="text-align:left">?</td>
</tr>
<tr>
<td style="text-align:left">应用需要99.999%高可用</td>
<td style="text-align:left">?</td>
</tr>
<tr>
<td style="text-align:left">应用需要大量的地理位置查询、文本查询</td>
<td style="text-align:left">？</td>
</tr>
</tbody>
</table>
<p>如果上述有1个 Yes，可以考虑 MongoDB，2个及以上的 Yes，选择MongoDB绝不会后悔。<br>作者：阿里云云栖社区<br>链接：<a href="https://yq.aliyun.com/articles/64352?spm=5176.8091938.0.0.oAHbxp" target="_blank" rel="external">https://yq.aliyun.com/articles/64352?spm=5176.8091938.0.0.oAHbxp</a><br>来源：知乎</p>
<h3 id="MongoDB安装和使用"><a href="#MongoDB安装和使用" class="headerlink" title="MongoDB安装和使用"></a>MongoDB安装和使用</h3><p>一、安装：</p>
<ol>
<li>官网：<a href="http://www.mongodb.org/downloads，下载对应系统的32/64位msi格式安装包" target="_blank" rel="external">http://www.mongodb.org/downloads，下载对应系统的32/64位msi格式安装包</a></li>
<li>安装路径：例 D:\MongoDB （路径可选，但不宜过深）</li>
<li>安装完的配置：<br>　　　　在D:\MongoDB\下新建data文件夹<br>　　　　在D:\MongoDB\data下新建db和log文件夹<br>　　　　在D:\MongoDB\data\log下新建MongoDB.log文件<br>二、启动：</li>
<li>进入D:\MongoDB\bin，输入：<br>mongod –dbpath D:\MongoDB\data\db<br>作用：将mongodb的数据库文件创建到D:\MongoDB\Data\db目录<br>此时界面会停在  2016-10-26T14:55:37.044+0800 I NETWORK  [initandlisten] waiting for connections on port 27017<br>此时数据库就已经启动。</li>
<li>新开一个cmd窗口，运行mongo.exe 程序 ，此时前一个窗口显示  2016-10-26T14:56:05.855+0800 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:60584 #1 (1 connection now open)<br>现在就可以使用mongodb数据库了。<br>三、使用：</li>
<li>在之前运行mongo.exe的cmd窗口中，输入use testdb 来创建testdb数据库。</li>
<li>输入db.addUser(“test”,”123”)为testdb创建一个用户<br>注意：V3版本mongoDB已经不再使用addUser，而是采用了db.createUser,不同版本创建用户语句有所不同<br>db.createUser(<br>{<br> user: “test”,<br> pwd: “test”,<br> roles: [ { role: “userAdmin”, db: “test” } ]<br>}<br>)</li>
</ol>
<p>//windows 加入服务<br>mongod.exe –logpath D:/MongoDB/data/log/mongodb.log –logappend –dbpath D:/MongoDB/data –directoryperdb –serviceName MongoDB -install  </p>
<h3 id="MongoDB依赖引入"><a href="#MongoDB依赖引入" class="headerlink" title="MongoDB依赖引入"></a>MongoDB依赖引入</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">&lt;dependency&gt;</div><div class="line">    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;</div><div class="line">    &lt;artifactId&gt;spring-boot-starter-data-mongodb&lt;/artifactId&gt;</div><div class="line">&lt;/dependency&gt;</div></pre></td></tr></table></figure>
<h3 id="MongoDB参数配置"><a href="#MongoDB参数配置" class="headerlink" title="MongoDB参数配置"></a>MongoDB参数配置</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="comment">#mongodb://name:pass@localhost:27017/test</span></div><div class="line"> spring:</div><div class="line">  data:</div><div class="line">    mongodb:</div><div class="line">      uri: mongodb://<span class="variable">$&#123;mongodb对应db用户名&#125;</span>:<span class="variable">$&#123;&#123;mongodb对应db密码&#125;</span>@<span class="variable">$&#123;mongodbIp和端口&#125;</span>/<span class="variable">$&#123;mongoDB的db名称&#125;</span></div></pre></td></tr></table></figure>
<h3 id="MongoDB存取实体类"><a href="#MongoDB存取实体类" class="headerlink" title="MongoDB存取实体类"></a>MongoDB存取实体类</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div></pre></td><td class="code"><pre><div class="line"><span class="comment">#存取实体User</span></div><div class="line">public class User &#123;</div><div class="line">    @Id</div><div class="line">    private Long id;</div><div class="line">    private String username;</div><div class="line">    private Integer age;</div><div class="line">    public User(Long id, String username, Integer age) &#123;</div><div class="line">        this.id = id;</div><div class="line">        this.username = username;</div><div class="line">        this.age = age;</div><div class="line">    &#125;</div><div class="line">    // 省略getter和setter</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h3 id="定义MongoDB存取接口"><a href="#定义MongoDB存取接口" class="headerlink" title="定义MongoDB存取接口"></a>定义MongoDB存取接口</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="comment">#存取实体服务接口</span></div><div class="line"></div><div class="line">public interface UserRepository extends MongoRepository&lt;User, Long&gt; &#123;</div><div class="line">    User findByUsername(String username);</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h3 id="测试存取操作"><a href="#测试存取操作" class="headerlink" title="测试存取操作"></a>测试存取操作</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div></pre></td><td class="code"><pre><div class="line">  </div><div class="line">@RunWith(SpringJUnit4ClassRunner.class)</div><div class="line">@SpringApplicationConfiguration(Application.class)</div><div class="line">public class ApplicationTests &#123;</div><div class="line">	@Autowired</div><div class="line">	private UserRepository userRepository;</div><div class="line">	@Before</div><div class="line">	public void <span class="function"><span class="title">setUp</span></span>() &#123;</div><div class="line">		userRepository.deleteAll();</div><div class="line">	&#125;</div><div class="line">	@Test</div><div class="line">	public void <span class="built_in">test</span>() throws Exception &#123;</div><div class="line">		// 创建三个User，并验证User总数</div><div class="line">		userRepository.save(new User(1L, <span class="string">"didi"</span>, 30));</div><div class="line">		userRepository.save(new User(2L, <span class="string">"mama"</span>, 40));</div><div class="line">		userRepository.save(new User(3L, <span class="string">"kaka"</span>, 50));</div><div class="line">		Assert.assertEquals(3, userRepository.findAll().size());</div><div class="line">		// 删除一个User，再验证User总数</div><div class="line">		User u = userRepository.findOne(1L);</div><div class="line">		userRepository.delete(u);</div><div class="line">		Assert.assertEquals(2, userRepository.findAll().size());</div><div class="line">		// 删除一个User，再验证User总数</div><div class="line">		u = userRepository.findByUsername(<span class="string">"mama"</span>);</div><div class="line">		userRepository.delete(u);</div><div class="line">		Assert.assertEquals(1, userRepository.findAll().size());</div><div class="line">	&#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>

        </div>

        <blockquote class="post-copyright">
    <div class="content">
        
<span class="post-time">
    最后更新时间：<time datetime="2017-06-28T08:16:51.556Z" itemprop="dateUpdated">2017年6月28日 16:16</time>
</span><br>


        如要转载请注明出处：<a href="/2017/06/28/mongodb/" target="_blank" rel="external">http://fish_08.oschina.io/2017/06/28/mongodb/</a>
    </div>
    <footer>
        <a href="http://fish_08.oschina.io">
            <img src="/img/avatar.jpg" alt="于亮">
            于亮
        </a>
    </footer>
</blockquote>

        
<div class="page-reward">
    <a id="rewardBtn" href="javascript:;" class="page-reward-btn waves-effect waves-circle waves-light">赏</a>
</div>



        <div class="post-footer">
            
	<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/MongoDB/">MongoDB</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/SpringBoot/">SpringBoot</a></li></ul>


            
<div class="page-share-wrap">
    

<div class="page-share" id="pageShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://fish_08.oschina.io/2017/06/28/mongodb/&title=《MongoDB》 — 尼古拉斯-鱼丸博客&pic=http://fish_08.oschina.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://fish_08.oschina.io/2017/06/28/mongodb/&title=《MongoDB》 — 尼古拉斯-鱼丸博客&source=" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://fish_08.oschina.io/2017/06/28/mongodb/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《MongoDB》 — 尼古拉斯-鱼丸博客&url=http://fish_08.oschina.io/2017/06/28/mongodb/&via=http://fish_08.oschina.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://fish_08.oschina.io/2017/06/28/mongodb/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>



    <a href="javascript:;" id="shareFab" class="page-share-fab waves-effect waves-circle">
        <i class="icon icon-share-alt icon-lg"></i>
    </a>
</div>



        </div>
    </div>

    
<nav class="post-nav flex-row flex-justify-between">
  
    <div class="waves-block waves-effect prev">
      <a href="/2017/06/28/quartz/" id="post-prev" class="post-nav-link">
        <div class="tips"><i class="icon icon-angle-left icon-lg icon-pr"></i> Prev</div>
        <h4 class="title">Quartz</h4>
      </a>
    </div>
  

  
    <div class="waves-block waves-effect next">
      <a href="/2017/06/28/hello-world/" id="post-next" class="post-nav-link">
        <div class="tips">Next <i class="icon icon-angle-right icon-lg icon-pl"></i></div>
        <h4 class="title">Hello World</h4>
      </a>
    </div>
  
</nav>



    







</article>

<div id="reward" class="page-modal reward-lay">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <h3 class="reward-title">
        <i class="icon icon-quote-left"></i>
        谢谢包子~
        <i class="icon icon-quote-right"></i>
    </h3>
    <ul class="reward-items">
        
        <li>
            <img src="/img/wechat.png" title="微信打赏二维码" alt="微信打赏二维码">
            <p>微信</p>
        </li>
        

        
        <li>
            <img src="/img/alipay.png" title="支付宝打赏二维码" alt="支付宝打赏二维码">
            <p>支付宝</p>
        </li>
        
    </ul>
</div>



</div>

        <footer class="footer">
    <div class="top">
        
<p>
    <span id="busuanzi_container_site_uv" style='display:none'>
        站点总访客数：<span id="busuanzi_value_site_uv"></span>
    </span>
    <span id="busuanzi_container_site_pv" style='display:none'>
        站点总访问量：<span id="busuanzi_value_site_pv"></span>
    </span>
</p>


        <p>
            <span><a href="/atom.xml" target="_blank" class="rss" title="rss"><i class="icon icon-lg icon-rss"></i></a></span>
            <span>博客内容遵循 <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">知识共享 署名 - 非商业性 - 相同方式共享 4.0协议</a></span>
        </p>
    </div>
    <div class="bottom">
        <p>
            <span>Power by <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="http://fish_08.oschina.io/" target="_blank">yuliang</a></span>
            <span>尼古拉斯-鱼丸博客 &copy; 2015 - 2018</span>
        </p>
    </div>
</footer>

    </main>
    <div class="mask" id="mask"></div>
<a href="javascript:;" id="gotop" class="waves-effect waves-circle waves-light"><span class="icon icon-lg icon-chevron-up"></span></a>



<div class="global-share" id="globalShare">
    <ul class="reset share-icons">
      <li>
        <a class="weibo share-sns" target="_blank" href="http://service.weibo.com/share/share.php?url=http://fish_08.oschina.io/2017/06/28/mongodb/&title=《MongoDB》 — 尼古拉斯-鱼丸博客&pic=http://fish_08.oschina.io/img/avatar.jpg" data-title="微博">
          <i class="icon icon-weibo"></i>
        </a>
      </li>
      <li>
        <a class="weixin share-sns wxFab" href="javascript:;" data-title="微信">
          <i class="icon icon-weixin"></i>
        </a>
      </li>
      <li>
        <a class="qq share-sns" target="_blank" href="http://connect.qq.com/widget/shareqq/index.html?url=http://fish_08.oschina.io/2017/06/28/mongodb/&title=《MongoDB》 — 尼古拉斯-鱼丸博客&source=" data-title=" QQ">
          <i class="icon icon-qq"></i>
        </a>
      </li>
      <li>
        <a class="facebook share-sns" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http://fish_08.oschina.io/2017/06/28/mongodb/" data-title=" Facebook">
          <i class="icon icon-facebook"></i>
        </a>
      </li>
      <li>
        <a class="twitter share-sns" target="_blank" href="https://twitter.com/intent/tweet?text=《MongoDB》 — 尼古拉斯-鱼丸博客&url=http://fish_08.oschina.io/2017/06/28/mongodb/&via=http://fish_08.oschina.io" data-title=" Twitter">
          <i class="icon icon-twitter"></i>
        </a>
      </li>
      <li>
        <a class="google share-sns" target="_blank" href="https://plus.google.com/share?url=http://fish_08.oschina.io/2017/06/28/mongodb/" data-title=" Google+">
          <i class="icon icon-google-plus"></i>
        </a>
      </li>
    </ul>
 </div>


<div class="page-modal wx-share" id="wxShare">
    <a class="close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <img src="" alt="微信分享二维码">
</div>




    <script src="//cdn.bootcss.com/node-waves/0.7.4/waves.min.js"></script>
<script>
var BLOG = { ROOT: '/', SHARE: true, REWARD: true };



</script>

<script src="/js/main.min.js?v=1.6.7"></script>


<div class="search-panel" id="search-panel">
    <ul class="search-result" id="search-result"></ul>
</div>
<template id="search-tpl">
<li class="item">
    <a href="{path}" class="waves-block waves-effect">
        <div class="title ellipsis" title="{title}">{title}</div>
        <div class="flex-row flex-middle">
            <div class="tags ellipsis">
                {tags}
            </div>
            <time class="flex-col time">{date}</time>
        </div>
    </a>
</li>
</template>

<script src="/js/search.min.js?v=1.6.7" async></script>






<script async src="//dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>


</body>
</html>
